//加载商品
function get_goods_list( info, url )
{
		$.ajax( {
			url: url || '/gmk/gatherShow/showSynthesis',
			type: 'post',
			data: info,
			beforeSend: function()
			{
				loading( "rgba(0,0,0,0.66)", "spinner1" );
				/*$( '.page-wrap' ).hide();*/
			},
			complete: function()
			{
				loading_success();
			},
			success: function( a )
			{
				a=eval("("+a+")");
				console.log(a)
				a=JSON.parse(a)
				if( a.status == 'SUCESS' )
				{
					console.log( "111111111111111" );
					if( !isNull( a.data.counts ) && (info.type != 3 && info.type != 4) )
					{
						$( '.goods-total span' ).html( a.data.counts );
					}
					if( !isNull( a.data.list ) )
					{
						if( a.data.list.length > 0 )
						{
							var s = '';
							$( a.data.list ).each( function( i, e )
							{

								
								var b = '';
								var h = '';
								if( e.shopType == 2 )
								{  //   天猫
									b = '../../img/tianmao.png';
									h = "https://detail.tmall.com/item.htm?id=" + e.itemId;
								}
								else
								{  //  淘宝
									b = '../../img/taobao.png';
									h = "https://item.taobao.com/item.htm?id=" + e.itemId;
								}
								var k = "http://shop.m.taobao.com/shop/coupon.htm?seller_id=" + e.sellerId + "&activity_id=" + e.couponId +
												"&v=0";
								var t = '';
								if( e.commissionType == 2 )
								{
									t = '定向';
								}
								else
									if( e.commissionType == 3 )
									{
										t = '鹊桥';
									}
									else
									{
										t = '通用';
									}
								if( e.goodsName.length > 16 )
								{
									e.goodsName = e.goodsName.substr( 0, 16 ) + '..'
								}
								var x = '正在统计';
								if( isNull( e.voucherPrice ) )
								{
									x = '正在统计';
								}
								else
								{
									x = e.voucherPrice;
								}
								var over = '';
								if( e.state == 0 )
								{ //  正常
									over = '';
								}
								else
								{ //  过期
									over = '<div class="is-over"><div class="is-over-inner">已抢完</div></div>';
								}
								var order = (info.pageSize - 1) * 40 + i + 1;
								if( e.goodType == 1 )
								{ // 聚划算
									var goodsType = '<img src="../../img/jhs.png" alt="">';
								}
								else
									if( e.goodType == 2 )
									{ // 淘抢购
										var goodsType = '<img src="../../img/tqg.png" alt="">';
									}
									else
									{
										var goodsType = '';
									}
								if( isNull( e.nowNumbers ) )
								{
									e.nowNumbers = '已领券量正在统计';
									e.surplusCoupon = '已领券量正在统计'
								}
								else
								{
									e.surplusCoupon = '已领券' + e.nowNumbers + '张（剩' + e.surplusCoupon + '）张'
									e.nowNumbers = '已领券' + e.nowNumbers + '张';
								}
								if( isNull( e.count ) )
								{
									e.count = '正在统计';
								}
								if( e.goodType == '1' )
								{ //  聚划算
									e.goodType = '../../img/poly_birds_poly_logo.png';
								}
								else
								{
									e.goodType = '../../img/poly_birds_birds_logo.png';
								}

								var btnText="";
								var itemClass="";
								if($(".head-right2").is( ":visible" ) && $(".head-right2 .releaseIcon").is( ":hidden" )){//已登录且为管理员，加入选品按钮不可见
									btnText= '<div class="copy-btn"  copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
												 '复制文案' +
												 '</div>';
									itemClass="item1";
								}else{
									btnText='<div class="handleArea"> '+
									 '<div class="add-btn">加入选品</div>'+
									 '<div class="copy-btn"  copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
									 '复制文案' +
									 '</div>' +
									 '</div>';
								}
								
								switch( info.type )
								{
									case 1 : //综合
										s += '<div class="item '+ itemClass+'" itemid='+e.itemId+' couponid='+e.couponId+'>' +
												 '<div class="item-img-wrap">' +
												 over +
												 '<div class="item-logo">' +
												 'TOP <br />' +
												 formatSort( order ) +
												 '</div>' +
												 '<div class="item-img">' +
												 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
												 '</div>' +
												 btnText+
												 '</div>' +
												 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
												 '<div class="coupon">' +
												 '<div class="left">' +
												 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
												 '<h3>券后价</h3>' +
												 '</div>' +
												 '<div class="left">' +
												 '<h2>￥<span>' + e.count + '</span></h2>' +
												 '<h3>优惠券</h3>' +
												 '</div>' +
												 '<div class="left last">' +
												 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
												 '<h3>' + t + '</h3>' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 '</div>' +
												 ' <div class="coupon-btn btn">' +
												 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
												 '</div>' +
												 '<h4>' + e.createTime + '&nbsp;&nbsp;&nbsp;发布</h4>' +
												 ' <div class="item-more">' +
												 '<div class="left">' +
												 '销量<span>' + e.effectSales + '</span>' +
												 '</div>' +
												 '<div class="right">' +
												 goodsType +
												 '<img src="' + b + '" alt="">' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 ' </div>' +
												 '</div>	';
										break;
									case 2 : // 实时上新
										s += '<div class="item '+ itemClass+'" itemid='+e.itemId+' couponid='+e.couponId+'>' +
												 '<div class="item-img-wrap">' +
												 over +
												 '<div class="item-logo">' +
												 '<img src="../../img/poly_birds_birds_logo.png" alt="">' +
												 '</div>' +
												 '<div class="item-img">' +
												 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
												 '</div>' +
												 btnText+
												 '</div>' +
												 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
												 '<div class="coupon">' +
												 '<div class="left">' +
												 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
												 '<h3>券后价</h3>' +
												 '</div>' +
												 '<div class="left">' +
												 '<h2>￥<span>' + e.count + '</span></h2>' +
												 '<h3>优惠券</h3>' +
												 '</div>' +
												 '<div class="left last">' +
												 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
												 '<h3>' + t + '</h3>' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 '</div>' +
												 ' <div class="coupon-btn btn">' +
												 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
												 '</div>' +
												 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
												 ' <div class="item-more">' +
												 '<div class="left">' +
												 '销量<span>' + e.effectSales + '</span>' +
												 '</div>' +
												 '<div class="right">' +
												 goodsType +
												 '<img src="' + b + '" alt="">' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 ' </div>' +
												 '</div>	';
										break;
									case 3 : //  销量榜
										$( '.page-wrap' ).hide();//隐藏页码
										if( info.flag == 2 )
										{ //  全天
											e.salesAdd = '24小时内销售' + e.salesAdd + '件'
										}
										if( info.flag == 3 )
										{ //  全天
											e.salesAdd = '48小时内销售' + e.salesAdd + '件'
										}
										if( info.flag == 4 )
										{ //  全天
											e.salesAdd = '72小时内销售' + e.salesAdd + '件'
										}
										if( info.flag == 1 )
										{ //  2
											e.salesAdd = '2小时内销售' + e.salesAdd + '件'
										}

										s += '<div class="item '+ itemClass+'" itemid='+e.itemId+' couponid='+e.couponId+'>' +
												 '<div class="item-img-wrap">' +
												 over +
												 '<div class="item-logo1" style="background:url(..\/..\/img\/top.png)">' +
												 'TOP <br />' +
												 formatSort( order ) +
												 '</div>' +
												 '<div class="item-img">' +
												 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
												 '</div>' +
												 btnText+
												 '</div>' +
												 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
												 '<div class="coupon">' +
												 '<div class="left">' +
												 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
												 '<h3>券后价</h3>' +
												 '</div>' +
												 '<div class="left">' +
												 '<h2>￥<span>' + e.count + '</span></h2>' +
												 '<h3>优惠券</h3>' +
												 '</div>' +
												 '<div class="left last">' +
												 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
												 '<h3>' + t + '</h3>' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 '</div>' +
												 '<a href="' + k + '" target="_blank" class="coupon-link">' + e.surplusCoupon + '</a>' +
												 ' <div class="coupon-btn btn">' +
												 e.salesAdd +
												 '</div>' +
												 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
												 ' <div class="item-more">' +
												 '<div class="left">' +
												 '销量<span>' + e.effectSales + '</span>' +
												 '</div>' +
												 '<div class="right">' +
												 goodsType +
												 '<img src="' + b + '" alt="">' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 ' </div>' +
												 '</div>	';
										break;
									case 4 : //  领券榜
										s += '<div class="item '+ itemClass+'" itemid='+e.itemId+' couponid='+e.couponId+'>' +
												 '<div class="item-img-wrap">' +
												 over +
												 '<div class="item-logo" style="background:url(..\/..\/img\/top.png)">' +
												 'TOP <br />' +
												 formatSort( order ) +
												 '</div>' +
												 '<div class="item-img">' +
												 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
												 '</div>' +
												 btnText+
												 '</div>' +
												 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
												 '<div class="coupon">' +
												 '<div class="left">' +
												 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
												 '<h3>券后价</h3>' +
												 '</div>' +
												 '<div class="left">' +
												 '<h2>￥<span>' + e.count + '</span></h2>' +
												 '<h3>优惠券</h3>' +
												 '</div>' +
												 '<div class="left last">' +
												 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
												 '<h3>' + t + '</h3>' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 '</div>' +
												 ' <div class="coupon-btn btn">' +
												 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
												 '</div>' +
												 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
												 ' <div class="item-more">' +
												 '<div class="left">' +
												 '销量<span>' + e.effectSales + '</span>' +
												 '</div>' +
												 '<div class="right">' +
												 goodsType +
												 '<img src="' + b + '" alt="">' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 ' </div>' +
												 '</div>	';
										break;
									case 6 : // 人气排行
										s += '<div class="item '+ itemClass+'" itemid='+e.itemId+' couponid='+e.couponId+'>' +
												 '<div class="item-img-wrap">' +
												 over +
												 '<div class="item-logo1" style="background:url(..\/..\/img\/top.png)">' +
												 'TOP <br />' +
												 formatSort( order ) +
												 '</div>' +
												 '<div class="item-img">' +
												 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
												 '</div>' +
												 btnText+
												 '</div>' +
												 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
												 '<div class="coupon">' +
												 '<div class="left">' +
												 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
												 '<h3>券后价</h3>' +
												 '</div>' +
												 '<div class="left">' +
												 '<h2>￥<span>' + e.count + '</span></h2>' +
												 '<h3>优惠券</h3>' +
												 '</div>' +
												 '<div class="left last">' +
												 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
												 '<h3>' + t + '</h3>' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 '</div>' +
												 '<div style="text-align: center;margin-top: 24px;"><span style="color: #acacac;font-size:small;">在线人数：</span><span style="color: deepskyblue">' + e.num_online + '</span></div>' +
												 ' <div class="coupon-btn btn">' +
												 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
												 '</div>' +
												 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
												 ' <div class="item-more">' +
												 '<div class="left">' +
												 '销量<span>' + e.effectSales + '</span>' +
												 '</div>' +
												 '<div class="right">' +
												 goodsType +
												 '<img src="' + b + '" alt="">' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 ' </div>' +
												 '</div>	';
										break;
									case 7 : //  聚 + 淘
										s += '<div class="item '+itemClass+'" itemid='+e.itemId+' couponid='+e.couponId+'>' +
												 '<div class="item-img-wrap">' +
												 over +
												 '<div class="item-logo">' +
												 '<img src="' + e.goodType + '" alt="">' +
												 '</div>' +
												 '<div class="item-img">' +
												 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
												 '</div>' +
												 btnText+
												 '</div>' +
												 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
												 '<div class="coupon">' +
												 '<div class="left">' +
												 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
												 '<h3>券后价</h3>' +
												 '</div>' +
												 '<div class="left">' +
												 '<h2>￥<span>' + e.count + '</span></h2>' +
												 '<h3>优惠券</h3>' +
												 '</div>' +
												 '<div class="left last">' +
												 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
												 '<h3>' + t + '</h3>' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 '</div>' +
												 ' <div class="coupon-btn btn">' +
												 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
												 '</div>' +
												 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
												 ' <div class="item-more">' +
												 '<div class="left">' +
												 '销量<span>' + e.effectSales + '</span>' +
												 '</div>' +
												 '<div class="right">' +
												 goodsType +
												 '<img src="' + b + '" alt="">' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 ' </div>' +
												 ' </div> ';
										break;
									case 100 :  // 搜索
										s += '<div class="item '+itemClass+'" itemid='+e.itemId+' couponid='+e.couponId+'>' +
												 '<div class="item-img-wrap">' +
												 over +
												 '<div class="item-logo">' +
												 '<img src="../../img/quality_goods_logo.png" alt="">' +
												 '</div>' +
												 '<div class="item-img">' +
												 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
												 '</div>' +
												 btnText+
												 '</div>' +
												 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
												 '<div class="coupon">' +
												 '<div class="left">' +
												 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
												 '<h3>券后价</h3>' +
												 '</div>' +
												 '<div class="left">' +
												 '<h2>￥<span>' + e.count + '</span></h2>' +
												 '<h3>优惠券</h3>' +
												 '</div>' +
												 '<div class="left last">' +
												 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
												 '<h3>' + t + '</h3>' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 '</div>' +
												 ' <div class="coupon-btn btn">' +
												 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
												 '</div>' +
												 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
												 ' <div class="item-more">' +
												 '<div class="left">' +
												 '销量<span>' + e.effectSales + '</span>' +
												 '</div>' +
												 '<div class="right">' +
												 goodsType +
												 '<img src="' + b + '" alt="">' +
												 '</div>' +
												 '<div class="clearfix"></div>' +
												 ' </div>' +
												 '</div>	';
										break;
								}

							} );
							s += '<div class="clearfix"></div>';
							$( '.goods-wrap' ).html( s );
							imgLazyLoad();//图片懒加载
							copy_int();//复制文案
							console.log( flag );
							if( flag && info.type != 3 && info.type != 4 )
							{
								//分页
								$( '.page-wrap' ).show();//显示页码
								$( "#page" ).Page( {
									totalPages: a.data.pageCount,//分页总数
									liNums: 7,//分页的数字按钮数(建议取奇数)
									current: info.pageSize, //当前页
									activeClass: 'activP', //active 类样式定义
									callBack: function( page )
									{
										$( 'body,html' ).animate( { scrollTop: '520px' }, 500 );
										flag = false;
										info.pageSize = page;
										get_goods_list( info );
									}
								} );
							}
						}
						else
						{
							var s = '<div class="no-data">' +
											'<img src="../../img/no_data.png" alt="">' +
											'什么都没找到,怪我咯~' +
											'<div>';
							$( '.goods-wrap' ).html( s );
						}
					}
					else
					{
						var s = '<div class="no-data">' +
										'<img src="../../img/no_data.png" alt="">' +
										'什么都没找到,怪我咯~' +
										'<div>';
						$( '.goods-wrap' ).html( s );
					}
				}
				else
				{
					var s = '<div class="no-data">' +
									'<img src="../../img/no_data.png" alt="">' +
									'什么都没找到,怪我咯~' +
									'<div>';
					$( '.goods-wrap' ).html( s );
				}
			},
			error: function()
			{
				$.dialog( 'alert', '错误', '服务器走丢了', 1500 );
			}
		} )

}

//上下架加载商品
function get_goods_list_unShelve( info, url )
{
	$.ajax( {
		url: url || '/gmk/gatherShow/showSynthesis',
		type: 'post',
		data: info,
		beforeSend: function()
		{
			loading( "rgba(0,0,0,0.66)", "spinner1" );
		},
		complete: function()
		{
			loading_success();
		},
		success: function( a )
		{
			if( a.status == 'SUCESS' )
			{
				if( !isNull( a.data.counts ) && (info.type != 3 && info.type != 4) )
				{
					$( '.goods-total span' ).html( a.data.counts );
				}
				if( !isNull( a.data.list ) )
				{
					if( a.data.list.length > 0 )
					{
						var s = '';
						$( a.data.list ).each( function( i, e )
						{
							console.log( info.flag );
							var b = '';
							var h = '';
							if( e.shopType == 2 )
							{  //   天猫
								b = '../../img/tianmao.png';
								h = "https://detail.tmall.com/item.htm?id=" + e.itemId;
							}
							else
							{  //  淘宝
								b = '../../img/taobao.png';
								h = "https://item.taobao.com/item.htm?id=" + e.itemId;
							}
							var k = "http://shop.m.taobao.com/shop/coupon.htm?seller_id=" + e.sellerId + "&activity_id=" + e.couponId +
											"&v=0";
							var commissionType = e.commissionType;
							var t = getCommissionType( commissionType );//获取优惠类型
							var x = '正在统计';
							if( isNull( e.voucherPrice ) )
							{
								x = '正在统计';
							}
							else
							{
								x = e.voucherPrice;
							}
							var over = '';
							if( e.state == 0 )
							{ //  正常
								over = '';
							}
							else
							{ //  过期
								over = '<div class="is-over"><div class="is-over-inner">已抢完</div></div>';
							}
							var order = (info.pageSize - 1) * 40 + i + 1;
							if( e.goodType == 1 )
							{ // 聚划算
								var goodsType = '<img src="../../img/jhs.png" alt="">';
							}
							else
								if( e.goodType == 2 )
								{ // 淘抢购
									var goodsType = '<img src="../../img/tqg.png" alt="">';
								}
								else
								{
									var goodsType = '';
								}
							if( isNull( e.nowNumbers ) )
							{
								e.nowNumbers = '已领券量正在统计';
								e.surplusCoupon = '已领券量正在统计'
							}
							else
							{
								e.surplusCoupon = '已领券' + e.nowNumbers + '张（剩' + e.surplusCoupon + '）张'
								e.nowNumbers = '已领券' + e.nowNumbers + '张';
							}
							if( isNull( e.count ) )
							{
								e.count = '正在统计';
							}
							if( e.goodType == '1' )
							{ //  聚划算
								e.goodType = '../../img/poly_birds_poly_logo.png';
							}
							else
							{
								e.goodType = '../../img/poly_birds_birds_logo.png';
							}

							var btnAreaText='<div class="btnArea hide"> ' +
							'<div class="btn downShelf" onclick="downShelf(this);" >下架</div>' +
							'</div> ';
							switch( info.type )
							{
								case 1 : //  综合
									s += '<div class="item item1 checkItem" itemid='+e.itemId+' couponid='+e.couponId+'>' +
											 '<div class="item-img-wrap">' +
											 over +
											 '<div class="item-img">' +
											 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
											 btnAreaText+
											 '</div>' +

											 '<div class="copy-btn"  copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
											 '复制文案' +
											
											 '</div>' +
											 '</div>' +
											 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
											 '<div class="coupon">' +
											 '<div class="left">' +
											 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
											 '<h3>券后价</h3>' +
											 '</div>' +
											 '<div class="left">' +
											 '<h2>￥<span>' + e.count + '</span></h2>' +
											 '<h3>优惠券</h3>' +
											 '</div>' +
											 '<div class="left last">' +
											 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
											 '<h3>' + t + '</h3>' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 '</div>' +
											 ' <div class="coupon-btn btn">' +
											 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
											 '</div>' +
											 '<h4>' + e.createTime + '&nbsp;&nbsp;&nbsp;发布</h4>' +
											 ' <div class="item-more">' +
											 '<div class="left">' +
											 '销量<span>' + e.effectSales + '</span>' +
											 '</div>' +
											 '<div class="right">' +
											 goodsType +
											 '<img src="' + b + '" alt="">' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 ' </div>' +
											 '</div>	';
									break;
								case 2 : // 实时上新
									s += '<div class="item item1 checkItem" itemid='+e.itemId+' couponid='+e.couponId+'>' +
											 '<div class="item-img-wrap">' +
											 over +
											 '<div class="item-logo">' +
											 '<img src="../../img/poly_birds_birds_logo.png" alt="">' +
											 '</div>' +
											 '<div class="item-img">' +
											 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
											 btnAreaText+
											 '</div>' +
											
											 '<div class="copy-btn"  copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
											 '复制文案' +
											
											 '</div>' +
											 '</div>' +
											 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
											 '<div class="coupon">' +
											 '<div class="left">' +
											 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
											 '<h3>券后价</h3>' +
											 '</div>' +
											 '<div class="left">' +
											 '<h2>￥<span>' + e.count + '</span></h2>' +
											 '<h3>优惠券</h3>' +
											 '</div>' +
											 '<div class="left last">' +
											 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
											 '<h3>' + t + '</h3>' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 '</div>' +
											 ' <div class="coupon-btn btn">' +
											 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
											 '</div>' +
											 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
											 ' <div class="item-more">' +
											 '<div class="left">' +
											 '销量<span>' + e.effectSales + '</span>' +
											 '</div>' +
											 '<div class="right">' +
											 goodsType +
											 '<img src="' + b + '" alt="">' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 ' </div>' +
											 '</div>	';
									break;
								case 3 : //  销量榜
									$( '.page-wrap' ).hide();//隐藏页码
									if( info.flag == 2 )
									{ //  全天
										e.salesAdd = '24小时内销售' + e.salesAdd + '件'
									}
									if( info.flag == 3 )
									{ //  全天
										e.salesAdd = '48小时内销售' + e.salesAdd + '件'
									}
									if( info.flag == 4 )
									{ //  全天
										e.salesAdd = '72小时内销售' + e.salesAdd + '件'
									}
									if( info.flag == 1 )
									{ //  2
										e.salesAdd = '2小时内销售' + e.salesAdd + '件'
									}

									s += '<div class="item item1 checkItem" itemid='+e.itemId+' couponid='+e.couponId+'>' +
											 '<div class="item-img-wrap">' +
											 over +
											 '<div class="item-logo1" style="background:url(..\/..\/img\/top.png)">' +
											 'TOP <br />' +
											 formatSort( order ) +
											 '</div>' +
											 '<div class="item-img">' +
											 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
											 btnAreaText+
											 '</div>' +
											
											 '<div class="copy-btn"  copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
											 '复制文案' +
											 
											 '</div>' +
											 '</div>' +
											 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
											 '<div class="coupon">' +
											 '<div class="left">' +
											 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
											 '<h3>券后价</h3>' +
											 '</div>' +
											 '<div class="left">' +
											 '<h2>￥<span>' + e.count + '</span></h2>' +
											 '<h3>优惠券</h3>' +
											 '</div>' +
											 '<div class="left last">' +
											 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
											 '<h3>' + t + '</h3>' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 '</div>' +
											 '<a href="' + k + '" target="_blank" class="coupon-link">' + e.surplusCoupon + '</a>' +
											 ' <div class="coupon-btn btn">' +
											 e.salesAdd +
											 '</div>' +
											 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
											 ' <div class="item-more">' +
											 '<div class="left">' +
											 '销量<span>' + e.effectSales + '</span>' +
											 '</div>' +
											 '<div class="right">' +
											 goodsType +
											 '<img src="' + b + '" alt="">' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 ' </div>' +
											 '</div>	';
									break;
								case 4 : //  领券榜
									s += '<div class="item item1 checkItem" itemid='+e.itemId+' couponid='+e.couponId+'>' +
											 '<div class="item-img-wrap">' +
											 over +
											 '<div class="item-logo" style="background:url(..\/..\/img\/top.png)">' +
											 'TOP <br />' +
											 formatSort( order ) +
											 '</div>' +
											 '<div class="item-img">' +
											 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
											 btnAreaText+
											 '</div>' +
											 '<div class="copy-btn"  copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
											 '复制文案' +

											 '</div>' +
											 '</div>' +
											 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
											 '<div class="coupon">' +
											 '<div class="left">' +
											 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
											 '<h3>券后价</h3>' +
											 '</div>' +
											 '<div class="left">' +
											 '<h2>￥<span>' + e.count + '</span></h2>' +
											 '<h3>优惠券</h3>' +
											 '</div>' +
											 '<div class="left last">' +
											 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
											 '<h3>' + t + '</h3>' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 '</div>' +
											 ' <div class="coupon-btn btn">' +
											 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
											 '</div>' +
											 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
											 ' <div class="item-more">' +
											 '<div class="left">' +
											 '销量<span>' + e.effectSales + '</span>' +
											 '</div>' +
											 '<div class="right">' +
											 goodsType +
											 '<img src="' + b + '" alt="">' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 ' </div>' +
											 '</div>	';
									break;
								case 6 : // 人气排行
									s += '<div class="item item1 checkItem" itemid='+e.itemId+' couponid='+e.couponId+'>' +
											 '<div class="item-img-wrap">' +
											 over +
											 '<div class="item-logo1">' +
											 'TOP <br />' +
											 formatSort( order ) +
											 '</div>' +
											 '<div class="item-img">' +
											 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
											 btnAreaText+
											 '</div>' +
											
											 '<div class="copy-btn"  copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
											 '复制文案' +
											
											 '</div>' +
											 '</div>' +
											 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
											 '<div class="coupon">' +
											 '<div class="left">' +
											 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
											 '<h3>券后价</h3>' +
											 '</div>' +
											 '<div class="left">' +
											 '<h2>￥<span>' + e.count + '</span></h2>' +
											 '<h3>优惠券</h3>' +
											 '</div>' +
											 '<div class="left last">' +
											 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
											 '<h3>' + t + '</h3>' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 '</div>' +
											 '<div style="text-align: center;margin-top: 24px;"><span style="color: #acacac;font-size:small;">在线人数：</span><span style="color: deepskyblue">' + e.num_online + '</span></div>' +
											 ' <div class="coupon-btn btn">' +
											 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
											 '</div>' +
											 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
											 ' <div class="item-more">' +
											 '<div class="left">' +
											 '销量<span>' + e.effectSales + '</span>' +
											 '</div>' +
											 '<div class="right">' +
											 goodsType +
											 '<img src="' + b + '" alt="">' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 ' </div>' +
											 '</div>	';
									break;
								case 7 : //  聚 + 淘
									s += '<div class="item item1 checkItem" itemid='+e.itemId+' couponid='+e.couponId+'>' +
											 '<div class="item-img-wrap">' +
											 over +
											 '<div class="item-logo">' +
											 '<img src="' + e.goodType + '" alt="">' +
											 '</div>' +
											 '<div class="item-img">' +
											 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
											 btnAreaText+
											 '</div>' +
											 
											 '<div class="copy-btn" copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
											 '复制文案' +
											
											 '</div>' +
											 '</div>' +
											 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
											 '<div class="coupon">' +
											 '<div class="left">' +
											 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
											 '<h3>券后价</h3>' +
											 '</div>' +
											 '<div class="left">' +
											 '<h2>￥<span>' + e.count + '</span></h2>' +
											 '<h3>优惠券</h3>' +
											 '</div>' +
											 '<div class="left last">' +
											 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
											 '<h3>' + t + '</h3>' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 '</div>' +
											 ' <div class="coupon-btn btn">' +
											 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
											 '</div>' +
											 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
											 ' <div class="item-more">' +
											 '<div class="left">' +
											 '销量<span>' + e.effectSales + '</span>' +
											 '</div>' +
											 '<div class="right">' +
											 goodsType +
											 '<img src="' + b + '" alt="">' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 ' </div>' +
											 '</div>	';
									break;
								case 100 :  //   搜索
									s += '<div class="item" itemid='+e.itemId+' couponid='+e.couponId+'>' +
											 '<div class="item-img-wrap">' +
											 over +
											 '<div class="item-logo">' +
											 '<img src="../../img/quality_goods_logo.png" alt="">' +
											 '</div>' +
											 '<div class="item-img">' +
											 '<a href="' + h + '" title="' + e.goodsName + '" target="_blank"><img class="scrollLoading" src=\'https://img.alicdn.com/imgextra/i4/1072286858/TB2xuvQt3NlpuFjy0FfXXX3CpXa_!!1072286858.png\' data-original="' + e.img + '"></a>' +
											 '</div>' +
											 '<div class="handleArea"> '+
											 '<div class="add-btn">加入选品</div>'+
											 '<div class="copy-btn"  copy-data=\'<img src="' + e.img2 + '" >' + e.message + '\' data-clipboard-target=".copy-data">' +
											 '复制文案' +
											 '</div>' +
											 '</div>' +
											 '</div>' +
											 ' <h1> <a href="' + h + '" title="' + e.goodsName + '" target="_blank">' + e.goodsName + '</a></h1>' +
											 '<div class="coupon">' +
											 '<div class="left">' +
											 '<h2>￥<span style="color:#03a9f4">' + x + '</span></h2>' +
											 '<h3>券后价</h3>' +
											 '</div>' +
											 '<div class="left">' +
											 '<h2>￥<span>' + e.count + '</span></h2>' +
											 '<h3>优惠券</h3>' +
											 '</div>' +
											 '<div class="left last">' +
											 '<h2>' + e.commissionProportion + '<span>%</span></h2>' +
											 '<h3>' + t + '</h3>' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 '</div>' +
											 ' <div class="coupon-btn btn">' +
											 '<a href="' + k + '" target="_blank">' + e.nowNumbers + '</a>' +
											 '</div>' +
											 '<h4>' + e.sfm + '&nbsp;&nbsp;&nbsp;发布</h4>' +
											 ' <div class="item-more">' +
											 '<div class="left">' +
											 '销量<span>' + e.effectSales + '</span>' +
											 '</div>' +
											 '<div class="right">' +
											 goodsType +
											 '<img src="' + b + '" alt="">' +
											 '</div>' +
											 '<div class="clearfix"></div>' +
											 ' </div>' +
											 '</div>	';
									break;
							}

						} );
						s += '<div class="clearfix"></div>';
						$( '.goods-wrap' ).html( s );
						imgLazyLoad();//图片懒加载
						copy_int();//复制文案
						console.log( flag );
						if( flag && info.type != 3 && info.type != 4 )
						{
							//分页
							$( '.page-wrap' ).show();//显示页码
							$( "#page" ).Page( {
								totalPages: a.data.pageCount,//分页总数
								liNums: 7,//分页的数字按钮数(建议取奇数)
								current: info.pageSize, //当前页
								activeClass: 'activP', //active 类样式定义
								callBack: function( page )
								{
									$( 'body,html' ).animate( { scrollTop: '520px' }, 500 );
									flag = false;
									info.pageSize = page;
									get_goods_list( info );
								}
							} );
						}
					}
					else
					{
						var s = '<div class="no-data">' +
										'<img src="../../img/no_data.png" alt="">' +
										'什么都没找到,怪我咯~' +
										'<div>';
						$( '.goods-wrap' ).html( s );
					}
				}
				else
				{
					var s = '<div class="no-data">' +
									'<img src="../../img/no_data.png" alt="">' +
									'什么都没找到,怪我咯~' +
									'<div>';
					$( '.goods-wrap' ).html( s );
				}
			}
			else
			{
				var s = '<div class="no-data">' +
								'<img src="../../img/no_data.png" alt="">' +
								'什么都没找到,怪我咯~' +
								'<div>';
				$( '.goods-wrap' ).html( s );
			}
		},
		error: function()
		{
			$.dialog( 'alert', '错误', '服务器走丢了', 1500 );
		}
	} )

}



